if(keyboard_check(ord("W")) || keyboard_check(ord("A")) || keyboard_check(ord("S")) || keyboard_check(ord("D")))
{
    if(Obj_Ghost.allowedMovement == 1)
    {
        if(global.Energy > 0)
        {
            global.Energy -= 0.5;
        }
    }
}

 
if(global.Energy < 100)
{
    global.Energy += 0.25;
}
